function accountcreation() {
    $.ajax({
        url:root.member.addMembers,
        cache: false,  //禁用缓存
        type: "POST",
        dataType:'json',
        contentType: "application/json",
        data: JSON.stringify({
            "loginAccount":$("#loginAccount").val(),
            "mainCustomerId":sessionStorage.getItem("mainCustomerId"),
            "status":$("input[name=status]:checked").val(),
            "createUser":JSON.parse(decodeURIComponent(web.readCookie("loginData"))).user.name,
            "employUser":$("#employUser").val(),
            "mobilePhone":$("#mobilePhone").val(),
            "email":$("#email").val(),
        }),
        success: function (data) {
            if (data.errorCode==0){
                layer.msg('创建成功', {icon: 6, time: 1000});
                setTimeout(function () {
                    window.parent.accountquerys();
                    var index = parent.layer.getFrameIndex(window.name);  // 关闭当前页面，并不刷新父级页面
                    parent.layer.close(index);
                }, 1000)
            } else {
                $.Huimodalalert(data.msg,2000);
            }
        },
        error: function () {
            $.Huimodalalert('失败！',2000);
        }
    });
}

function cancelbtn() {
    var index = parent.layer.getFrameIndex(window.name);  // 关闭当前页面，并不刷新父级页面
    parent.layer.close(index);
}

//获取主客户详细信息-puchOut
function mainCustomerInfo() {
    var param = { ids:sessionStorage.getItem("mainCustomerId") };
    console.log(param);
    $.ajax({
        url: root.member.mainCustomerInfo,
        cache: false, //禁用缓存
        type: "POST",
        dataType: 'json',
        contentType: "application/json",
        data:JSON.stringify(param),
        success: function (data) {
            if(data.errorCode == 0){
             if(data.data){
                 //10 数采客户组；20 punchout数采平台审核； 30 punchout客户平台审核
                if (data.data.customerType == 20) {
                    if (data.data.mainCustomerSettingsEntity) {
                        if (data.data.mainCustomerSettingsEntity.acceptLogin == 10) {
                            $('#normal').modal('show');
                        }else{
                            accountcreation();
                        }
                    }else{
                        accountcreation();
                    }
                 }else{
                    accountcreation();
                 }
             }else{
                $.Huimodalalert("未查到客户组详情",2000);
             }
            }else {
                $.Huimodalalert(data.msg,2000);
            }
        },
        error: function () {
            $.Huimodalalert('失败！',2000);
        }
      });
}